import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Tabbar from '../views/Tabbar.vue'

Vue.use(VueRouter)

const routes = [
  /* {
    path: '/',
    name: 'Home',
    component: Home
  }, */
  {
    path: '/',
    redirect: '/tabbar/home'
  },
  {
    path: '/tabbar',
    name: 'Tabbar',
    component: Tabbar,
    children: [
      {
        path: 'home',
        component: Home,
      },
      {
        path: 'topic',
        component: () => import(/* webpackChunkName: "topic" */ '../views/Topic.vue'),
      },
      {
        path: 'category',
        component: () => import(/* webpackChunkName: "category" */ '../views/Category.vue'),
      },
      {
        path: 'cart',
        component: () => import(/* webpackChunkName: "cart" */ '../views/Cart.vue'),
      },
      {
        path: 'user',
        component: () => import(/* webpackChunkName: "user" */ '../views/User.vue'),
      }
    ]
  },
  {
    path: '/popup',
    name: 'Popup',
    component: () => import(/* webpackChunkName: "popup" */ '../views/Popup.vue'),
  },
  {
    path: '/details',
    name: 'Details',
    component: () => import(/* webpackChunkName: "details" */ '../views/Details.vue'),
  },
  //goodscategory
  {
    path: '/goodcategiry',
    component: () => import(/* webpackChunkName: "goodscategory" */ '../views/GoodCategiry.vue'),
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
